hysop.operator.enstrophy module

@file enstrophy.py Enstrophy solver frontend.

class hysop.operator.enstrophy.Enstrophy(vorticity, enstrophy, variables, rho=None, rho_0=1.0, WdotW=None, implementation=None, base_kwds=None, **kwds)[source]

Bases: ComputationalGraphNodeFrontend

Interface computing enstrophy. Available implementations are:

*OPENCL (gpu based implementation) (default) *PYTHON

Initialize a Enstrophy operator frontend.

Enstrophy is the scaled volume average of rho*(W.W) on the domain where . represents the vector dot product).

in: W (vorticity field)

rho (density field, optional, defaults to 1.0 everywhere)

out: E = 1.0/(2*V*rho_0) * integral(rho*(W.W)) => enstrophy (scalar parameter)

where V is the domain volume, rho_0 the reference density.

Parameters:
  • vorticity (Field) – Input continuous vorticity field.

  • enstrophy (ScalarParameter) – Enstrophy scalar output parameter.

  • rho (Field, optional) – Input continuous density field, if not given, defaults to 1.0 on the whole domain.

  • rho_0 (float, optional) – Reference density, defaults to 1.0.

  • WdotW (Field, optional) – Output continuous field if required, will contain rho * (W.W) (term before integration). If WdotW is given, WdotW will contain rho * (W.W) else this will be a temporary field only usable during this operator’s apply method. Should have nb_components=1.

  • variables (dict) – dictionary of fields as keys and topologies as values.

  • implementation (Implementation, optional, defaults to None) – target implementation, should be contained in available_implementations(). If None, implementation will be set to default_implementation().

  • base_kwds (dict, optional, defaults to None) – Base class keywords arguments. If None, an empty dict will be passed.

  • kwds – Extra keywords arguments that will be passed towards implementation enstrophy operator __init__.

Notes

An Enstrophy operator implementation should at least support the hysop.operator.base.enstrophy.EnstrophyBase interface.

classmethod default_implementation()[source]

Return the default Implementation, should be compatible with available_implementations.

classmethod implementations()[source]

Should return all implementations as a dictionnary. Keys are Implementation instances and values are either ComputationalGraphNode or ComputationalGraphNodeGenerator.